/** 首页 api */
import request from "@/utils/request";

// 按机构查询相机
export function treeCameraData() {
  return request({
    url: "/system/dept/treeCameraData",
    method: "get",
  });
}

/**
 * 点击机构查询相机列表
 * @param {*} data
 * @returns
 */
export function getCamerasIndex(data) {
  return request({
    url: "/home/homeCamList",
    method: "post",
    data,
  });
}

/**
 * 获取视频流
 * @param {*} data
 */
export function getVideo(data) {
  return request({
    url: "/home/videoStreaming",
    method: "post",
    timeout: 100 * 1000,
    data,
  });
}

/**
 * 关闭视频流
 * @param {*} data
 */
export function closeVideo(data) {
  return request({
    url: "http://10.166.147.60:9021/home/closeVideotape",
    method: "get",
    headers: {
      isVideoToken: false,
    },
    params: data,
  });
}

// 摄像机操作控制接口
export function cameraHandle(data) {
  return request({
    url: "/home/PTZControl",
    method: "post",
    data,
  });
}
